<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function show() {
            alert("你好");
        }
        function changeback() {
            document.body.style.backgroundColor=document.getElementById("clr").value;
        }
    </script>
</head>
<body>

<button onclick="show()">点我</button>
<button id="btn2">点我</button>
<button id="btn3">点我</button>
<select id="sel" >
    <option value="1">红</option>
    <option value="2">绿</option>
</select>
<input id="clr" type="color" onchange="changeback()">
<script>
    document.getElementById("btn2").onclick = function () {
        alert("大家好");
    };
    document.getElementById("btn3").onclick = show;
    document.getElementById("sel").onchange = function () {
        if(document.getElementById("sel").value==1)
            document.body.style.backgroundColor="red";
        if(document.getElementById("sel").value==2)
            document.body.style.backgroundColor="green";
    };
</script>
</body>
</html>